package org.jsola.hr.dto;

import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.EqualsAndHashCode;
import org.hibernate.validator.constraints.Length;
import org.jsola.core.dto.BaseDTO;
import org.jsola.core.validator.Const;
import org.jsola.hr.constant.BalanceTypeEnum;

import javax.validation.constraints.NotNull;
import java.math.BigDecimal;

import static org.jsola.hr.example.CompanyBalanceRecordExample.*;

/**
 * 用工单位账面余额明细表
 *
 * @author zhr
 */
@EqualsAndHashCode(callSuper = true)
@ApiModel(description = "新增【用工单位账面余额明细表】的参数")
@Data
public class CompanyBalanceRecordAddDTO extends BaseDTO {

    private static final long serialVersionUID = 1L;

    @ApiModelProperty(notes = N_BALANCE_ID, example = E_BALANCE_ID, required = true)
    @NotNull(message = M_BALANCE_ID_NOT_NULL)
    private Long balanceId;

    @ApiModelProperty(notes = N_YEARLY, example = E_YEARLY, required = true)
    @NotNull(message = M_YEARLY_NOT_NULL)
    private Integer yearly;

    @ApiModelProperty(notes = N_MONTHLY, example = E_MONTHLY, required = true)
    @NotNull(message = M_MONTHLY_NOT_NULL)
    private Integer monthly;

    @ApiModelProperty(notes = N_COMPANY_ID, example = E_COMPANY_ID, required = true)
    @NotNull(message = M_COMPANY_ID_NOT_NULL)
    @Length(max = 20000, message = M_COMPANY_ID_MAX)
    private String companyId;

    @ApiModelProperty(notes = N_COMPANY_NAME, example = E_COMPANY_NAME, required = true)
    @NotNull(message = M_COMPANY_NAME_NOT_NULL)
    @Length(max = 32, message = M_COMPANY_NAME_MAX)
    private String companyName;

    @ApiModelProperty(notes = N_SITE_NAME, example = E_SITE_NAME, required = true)
    @NotNull(message = M_SITE_NAME_NOT_NULL)
    @Length(max = 32, message = M_SITE_NAME_MAX)
    private String siteName;

    @ApiModelProperty(notes = N_CHANGE_TYPE, example = E_CHANGE_TYPE, required = true, allowableValues = BalanceTypeEnum.VALUES_STR)
    @NotNull(message = M_CHANGE_TYPE_NOT_NULL)
    @Const(constClass = BalanceTypeEnum.class, message = M_CHANGE_TYPE_ENUM_NOT_MATCH)
    private Integer changeType;

    @ApiModelProperty(notes = N_DELETE_STATUS, example = E_DELETE_STATUS)
    private Boolean deleteStatus;

    @ApiModelProperty(notes = N_SUBJECT_ID, example = E_SUBJECT_ID, required = true)
    @NotNull(message = M_SUBJECT_ID_NOT_NULL)
    @Length(max = 32, message = M_SUBJECT_ID_MAX)
    private String subjectId;

    @ApiModelProperty(notes = N_CHANGE_AMOUNT, example = E_CHANGE_AMOUNT, required = true)
    @NotNull(message = M_CHANGE_AMOUNT_NOT_NULL)
    private BigDecimal changeAmount;

    @ApiModelProperty(notes = N_BEFORE_AMOUNT, example = E_BEFORE_AMOUNT, required = true)
    @NotNull(message = M_BEFORE_AMOUNT_NOT_NULL)
    private BigDecimal beforeAmount;

    @ApiModelProperty(notes = N_AFTER_AMOUNT, example = E_AFTER_AMOUNT, required = true)
    @NotNull(message = M_AFTER_AMOUNT_NOT_NULL)
    private BigDecimal afterAmount;


}

